package com.ly.service.search;

import com.ly.service.ServiceMultiResult;
import com.ly.service.ServiceResult;
import com.ly.web.form.MapSearch;
import com.ly.web.form.MapSearchDistrict;
import com.ly.web.form.RentSearch;
import com.ly.web.form.SearchDistrict;

import java.util.List;

/**
 * @author ：LY
 * @date ：Created in 2020/11/17 15:13
 * @modified By：
 */
public interface ISearchService {
    /**
     * 索引目标房源
     * @param houseId
     */
    void index(Long houseId);

    /**
     * 移除房源索引
     * @param houseId
     */
    void remove(Long houseId);

    /**
     * 查询房源接口
     * @param rentSerach
     * @return
     */
    ServiceMultiResult<Long> query(RentSearch rentSerach);

    /**
     * 获取补全建议关键词
     * @param prefix
     * @return
     */
    ServiceResult<List<String>> suggest(String prefix);

    /**
     * 聚合特定小区的房源数量
     * @param cityEnName
     * @param regionEnName
     * @param district
     * @return
     */
    ServiceResult<Long> aggregateDistrictHouse(String cityEnName,String regionEnName,String district);

    /**
     * 聚合城市数据
     * @param cityEnName
     * @return
     */
    ServiceMultiResult<HouseBuketDTO> mapAggregate(String cityEnName);


    /**
     * 城市级别查询
     * @return
     */
    ServiceMultiResult<Long> mapQuery(String cityEnName,String orderBy,String orederDirection,int start,int size);

    /**
     * 精确范围数据查询
     * @param mapSearch
     * @return
     */
    ServiceMultiResult<Long> mapQuery(MapSearch mapSearch);

    /**
     * 通过城市与小区查询房源信息
     * @param mapSearch
     * @return
     */
    ServiceMultiResult<Long> mapQuery(MapSearchDistrict mapSearch);
    /**
     * 聚合所有小区的房源数量
     * @param
     * @return
     */
     ServiceMultiResult<HouseBuketDTO> mapAggregateDistrict(SearchDistrict searchDistrict);


}
